﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DIProject.Reports
{	public partial class ChoiceReport : Form
	{	public System.Windows.Forms.DataGridView ReportsGridView{get{return reportsGridView;}}
		public ChoiceReport()
		{	InitializeComponent();
		}

		private void reportsGridView_CurrentCellChanged(object sender, EventArgs e)
		{	buttonAccept.Enabled = reportsGridView.CurrentCell != null;
		}

		private void reportsGridView_MouseDoubleClick(object sender, MouseEventArgs e)
		{	DataGridView.HitTestInfo hit = reportsGridView.HitTest(e.X, e.Y);
			if(hit.Type == DataGridViewHitTestType.Cell)
				DialogResult = DialogResult.OK;
		}

		private void reportsGridView_KeyDown(object sender, KeyEventArgs e)
		{	if(e.KeyCode == Keys.Enter)
				e.Handled = true;
		}

		private void reportsGridView_KeyPress(object sender, KeyPressEventArgs e)
		{	if(e.KeyChar == '\r' && reportsGridView.CurrentCell != null)
				DialogResult = DialogResult.OK;
		}
	}
}